#include"process.h"

typedef void (*callback_t) (double total, double current);



double total=1024.0;
double speed=1.0;

void DownLoad(callback_t cb)
{
    double current=0;
    while(current<=total)
    {
        cb(total,current);
        //下载
        usleep(5000);//充当下载数据
        current+=speed;
    }
    printf("\ndownload %.2lfMB Done\n",current);
    sleep(1);
}

void UpLoad(callback_t cb)
{
    double current=0;
    while(current<=total)
    {
        cb(total, current);
        usleep(5000);
        current+=speed;
    }
    printf("\nupload %.2lfMB Done\n",current);
    sleep(1);
}



int main()
{
   //process_v1(); 
    DownLoad(FlushProcess);
    DownLoad(FlushProcess);
    
    UpLoad(FlushProcess);

    return 0;
}
